cask "firefox" do
  version "145.0.2"

  language "ach" do
    sha256 "7de0ced714dc187adacd354622abda32996d2f9fca12e8c7ea7c0c7d394dd566"
    "ach"
  end
  language "af" do
    sha256 "29d28fb1a3147525380d4bf0b6fa8a82c6f8a30f02e5c03868487452220fd65d"
    "af"
  end
  language "an" do
    sha256 "68354a37b20f27e83abaf2235b8a2c31b968f042575ff339c30d54150b6e965c"
    "an"
  end
  language "ar" do
    sha256 "c1888ae4379606d95f3fc692f0e3a697e7b45a07b55aea3b4f237824ceed0207"
    "ar"
  end
  language "ast" do
    sha256 "7fe729136f0bcbdee7f1517255a70978bc71da988bda0520a19dfda7c9511c7b"
    "ast"
  end
  language "az" do
    sha256 "0a15339b0dbe8968d794cd0a95fc36cf890f055cb8eddd70bd4a6abc5c81d897"
    "az"
  end
  language "be" do
    sha256 "793e31624d6c084e4aca2be5d6d163b5af0c0b672c32a96488689ce10230225c"
    "be"
  end
  language "bg" do
    sha256 "c45b5208fe6f816101c848618f70817c569e91ab3455fa365153df79816fb8f4"
    "bg"
  end
  language "bn" do
    sha256 "f469c96365e2ea373f65512c2ee3ad4cae214e202026c107b2db5cce1af881ad"
    "bn"
  end
  language "br" do
    sha256 "1d0144d79edb01ca3bd1c5d84f241f58e1ee03a6fc5f4a1b427a9cd43858fff1"
    "br"
  end
  language "bs" do
    sha256 "0c59447873d3504a19c7fca1497803e6cf337b1a2dd6008deefd4a76cbb45fbd"
    "bs"
  end
  language "ca" do
    sha256 "5c6f42a855e8774748b8a16e7c42700a5cb9c753e1915c4848401dc6d1a5e53f"
    "ca"
  end
  language "cak" do
    sha256 "c9a2d445f265fcacef090b02d69ab12f6c842661d8572c54b353efbcacb2d94b"
    "cak"
  end
  language "cs" do
    sha256 "b50b9930726f2f558504cb3aeebf942af24e7827284f2fe19c0f066fd0e0bc82"
    "cs"
  end
  language "cy" do
    sha256 "68d3012fd9b1e7890ad482f8ba89564e3fddb20380671ccf01953e078bbeb98d"
    "cy"
  end
  language "da" do
    sha256 "6caff8522d49eac0c843c73b414f06d9ba26f615bf9668a53da563e6ebf257ed"
    "da"
  end
  language "de" do
    sha256 "709119afce010bae5c12a548d9c23e930639c1c2c8b571d5a57e31d35b58657f"
    "de"
  end
  language "dsb" do
    sha256 "cf38ff3f8e34e9fb5e7474f3c6a17e22b0524a9b222f912bdccee77f0e9d265a"
    "dsb"
  end
  language "el" do
    sha256 "0cd919b1f350a7e8409198c7eddd8fc71c0bb9d6466e03f30f991a11565a8d37"
    "el"
  end
  language "en-CA" do
    sha256 "83b35d798a2154dbf150345b28bfb0703660ed1033e4c650bcd32630b6104558"
    "en-CA"
  end
  language "en-GB" do
    sha256 "0512e6f21be71b848c667d4a4e7d40294d4208dadf9b13269a63711b7a987499"
    "en-GB"
  end
  language "en", default: true do
    sha256 "80f5851f90de88d1b8d27299cb0a3ff3b9ff3774c275de2675f651834bd9228b"
    "en-US"
  end
  language "eo" do
    sha256 "9bd1b53f3fd5fe1961d61098e5750599fb1fb5943e83d6303470ded2e50363d1"
    "eo"
  end
  language "es-AR" do
    sha256 "20bc059a4cfcd7cd35f1b56ed7bbcc0018725cb69bead56a7425709fb86f914b"
    "es-AR"
  end
  language "es-CL" do
    sha256 "5b7fef3f3de33bcdf043defaaaad2534527ad779f0544fcdf728c562de37ae80"
    "es-CL"
  end
  language "es-ES" do
    sha256 "b21f8cdb876516cdc28b17bd4ef3fa427b212929665b0b01872fa4c40e29c60f"
    "es-ES"
  end
  language "es-MX" do
    sha256 "948815da1659aa780e4d318d5f31628ddc7105a4a1094f2d5e0cc0e0449919f3"
    "es-MX"
  end
  language "et" do
    sha256 "daa86de8c7e13c1f26a1fa197d62a988920e4c2471104de2df46e20b041c5e43"
    "et"
  end
  language "eu" do
    sha256 "12fdb983622a68d52c5a8dd44981efd9ec2960310eca3748814b21c3de434d0d"
    "eu"
  end
  language "fa" do
    sha256 "c34ba300b426f4cf92b1a57b8314298dbd0d3a02d5c5982d3f017f010a642023"
    "fa"
  end
  language "ff" do
    sha256 "c3d04e9ef1faad6c7d1ab3a3b100e753356fb808020423a5aad42d9402491b65"
    "ff"
  end
  language "fi" do
    sha256 "340fab036d8c43cd78cec3408fce0716c6a80bc1284d8f5b82b6250b54a19c64"
    "fi"
  end
  language "fr" do
    sha256 "d7648fe26a147613278e9206ddd0efddc8b63029648476740de23669c91fcb1d"
    "fr"
  end
  language "fur" do
    sha256 "ae1625c69c9746e737433ebf03d75784e233b7fd8759858db8c4ee03a1e8d4a3"
    "fur"
  end
  language "fy" do
    sha256 "720c8e5ee801f535386fcb66b684fff3736994cf7b2cb34454ab08cc69bd5c7b"
    "fy-NL"
  end
  language "ga" do
    sha256 "7c995b9a0ec8390f417461b14a974df20676ef4847620aef9db0a0f1330d699e"
    "ga-IE"
  end
  language "gd" do
    sha256 "502c8afbec7fe81493fb6a89186e5a1a5667f43cb1fd4a4d264a9e705fd58e1d"
    "gd"
  end
  language "gl" do
    sha256 "7c1591889208c13eda977192e4a0c2ba33e3b934e2d5166ebb3518b912bca3f0"
    "gl"
  end
  language "gn" do
    sha256 "3b1bb996a7fe7f3c5f8151323139c7c4a2c9e280d456660b6fd54ad28f86f561"
    "gn"
  end
  language "gu" do
    sha256 "7aa871dd0b3b5d3ade8ca61f2792aa8c8552d3ce53c5e01b6b095a18f157cada"
    "gu-IN"
  end
  language "he" do
    sha256 "dfc877ec22951c111466558541e71540436e6899883533e00926f4c4ab2d4cfc"
    "he"
  end
  language "hi" do
    sha256 "4f3269f5f2df4c1ec0863d199a7c15823e162db61d4ef2bce354c7522b234702"
    "hi-IN"
  end
  language "hr" do
    sha256 "afb6de4f78ec221cd3664060749f8b9cdbc5e9bba4db1482866e63540be4ee13"
    "hr"
  end
  language "hsb" do
    sha256 "7e95f84306871172f79676b888599f7f7d9695c44c29386bb64d937858c3d982"
    "hsb"
  end
  language "hu" do
    sha256 "b5815775f06fa0183f6fd182f73a0ee2441f047063df4bdb16b7f7828d944f08"
    "hu"
  end
  language "hy" do
    sha256 "d0dbe2d900b92baabd83c27d6530d67b3eefebfcbb558bc83a0997c26cd9bfe2"
    "hy-AM"
  end
  language "ia" do
    sha256 "b7c5ee07a3e86458ffd2499e547fe79d97f6aa996c421b4b7f2ae19199b33801"
    "ia"
  end
  language "id" do
    sha256 "7309b0cf16cbf353087df0cccca3686930ed170055dfc241cc809ea440985884"
    "id"
  end
  language "in" do
    sha256 "4f3269f5f2df4c1ec0863d199a7c15823e162db61d4ef2bce354c7522b234702"
    "hi-IN"
  end
  language "is" do
    sha256 "92285b41dd86b8bbc84ec1648502ad09033b6e429920b7274610b35567cb2e1b"
    "is"
  end
  language "it" do
    sha256 "9e118f1a952f6d6e273f84d2b154996864fb3de292771f1badb3ea9de4d87d87"
    "it"
  end
  language "ja" do
    sha256 "162bf907fee76ef067008bea882b06ffccb1d21b7e32820e7d6f6f7229e36e52"
    "ja-JP-mac"
  end
  language "ka" do
    sha256 "7ae1854a3f5252487d689436f494ac4386016da9e7ff56f3060cafbaf39b5dfa"
    "ka"
  end
  language "kab" do
    sha256 "01b8bb81377cb2ca78df499f1cf175d32fcc0a87498d4ca826a2fafb321d7670"
    "kab"
  end
  language "kk" do
    sha256 "a67a685554c4c66f8460a7f35955d4f8ed2cfa97da167c25203746f8f1145c85"
    "kk"
  end
  language "km" do
    sha256 "e8d19d04c2f1a2d7de699151f2a309b0ca28321485b84619775487636c12e4ca"
    "km"
  end
  language "kn" do
    sha256 "76024d05d1769605b7d70b9ee5eb174c869e1f7bec68e211495ce16b86117790"
    "kn"
  end
  language "ko" do
    sha256 "06b91e95687598d7ef8c01ddc10fc5b35ce5efdf72c034344ab8a62d3a321f6d"
    "ko"
  end
  language "lij" do
    sha256 "650a03f02ce1d361e3cd15d36ac1bf2575b1315eb2e1e613000d4f8cddd41e4e"
    "lij"
  end
  language "lt" do
    sha256 "0188ecfe4fa6744c6a3c5c76a0bd15d883cb16633b1dc6cf722e42753d6b329b"
    "lt"
  end
  language "lv" do
    sha256 "72e56d7faea9885a09ad851d6d8f79cd3d943168d5abe5c5673024cf79fa75e6"
    "lv"
  end
  language "mk" do
    sha256 "168a50cddf59b39518affe48da4ad50abfd947ff16e7f672131f1b65ba307573"
    "mk"
  end
  language "mr" do
    sha256 "dd8a846e4285ac3ed2aa7b4c10476e3ac60af5ec1124aa6fd49d7f037182cd74"
    "mr"
  end
  language "ms" do
    sha256 "0d3a8611279010267851c689e308c7da39a4677b7ca132d783fcb1f369c2fe55"
    "ms"
  end
  language "my" do
    sha256 "d2dbc814dcff059069019f66cf7771210b2793a92b971bfeca6180721d43475e"
    "my"
  end
  language "nb" do
    sha256 "67b97883d412e207deb4980417bbe5c2707bf0ede2358419783bc852268962a9"
    "nb-NO"
  end
  language "ne" do
    sha256 "7b9c2e043b13186b9d7e818e7d7a16e41e956f5b67ba3ad87d7a54177baf35dc"
    "ne-NP"
  end
  language "nl" do
    sha256 "5a77b3aa7199852a7e98ffb208c84501ee55092edcfe19e0147837dd3fa7936f"
    "nl"
  end
  language "nn" do
    sha256 "f5d85974b06e14f2f071d631375e7258095be1f51cf470630769ff009365b63f"
    "nn-NO"
  end
  language "oc" do
    sha256 "7be86c3824f1545890fae2078031cc3c26b1acb0b0121bca3b5a2c8f3adde99d"
    "oc"
  end
  language "pa-IN" do
    sha256 "15ebfbce7f8278b46c0fa10262c59244ea0a57258366eb59827fd4b00b17b811"
    "pa-IN"
  end
  language "pl" do
    sha256 "1c441abca64fef53d5f7917dcdaa6d72b20afed0c5e9ea606da248170727552e"
    "pl"
  end
  language "pt-BR" do
    sha256 "d41aa6ecc7cfc9888feb9e304c713438e90fe77545f00ff2f2ae017ece05841a"
    "pt-BR"
  end
  language "pt" do
    sha256 "9db85027b655aca56523c3fa6721cba899119df38c9b581ad5631bcb0be25fa5"
    "pt-PT"
  end
  language "rm" do
    sha256 "aa1ae8b4e8decba9acf6f71d97f4c7fe807d49b6eeec5507a0de444d73798472"
    "rm"
  end
  language "ro" do
    sha256 "58d615d3efd6bc3ec8e57843f97cf7a0de503c4eabee9392a237de1861e23afd"
    "ro"
  end
  language "ru" do
    sha256 "4d46a7394f48dfed0e27c85f075e08aef118a5891d77bf87c2ebb2f0b84cfa4b"
    "ru"
  end
  language "sat" do
    sha256 "7cd39f57cca5afc34c2806a5b2762cb1d37c39510415813587d6e8efea9fa349"
    "sat"
  end
  language "sc" do
    sha256 "485307af0683a3e586246a8b87b3ae483c0ff3963cc273b7c69effd62544f40b"
    "sc"
  end
  language "sco" do
    sha256 "87dd889f0d02c7856bbf2a37ff5aa8fb5f90feb45ecb68a817ab64459142a111"
    "sco"
  end
  language "si" do
    sha256 "32be24157e20104b9235fc32f13a748f6eca146c0f83846ea06025fcc0c4ff37"
    "si"
  end
  language "sk" do
    sha256 "c70087d03dd367c1b8e189035fd56c1f3af0b5a4479591adf0baeb6a66a3dc02"
    "sk"
  end
  language "skr" do
    sha256 "5b836d2b97d37905ddaa2e974d448790ef022891d3da2565e6e8a3bfa0ef35e3"
    "skr"
  end
  language "sl" do
    sha256 "30064db442fc47577acbc62a7cb553bb76478c69b441b079a208b5ee475f7e14"
    "sl"
  end
  language "son" do
    sha256 "4965d9a9cb6317e9484184a80f94acbce4d5baf20e511c90f902f7d3ecb9682a"
    "son"
  end
  language "sq" do
    sha256 "a3e67ea03bdf5aaf959a26cbdf9414d52e28d1f99e3fb1e6ca103d7e9f4f0d8a"
    "sq"
  end
  language "sr" do
    sha256 "a1e1962afe97de834e4a222027f1926a1a26f3102ec072bf2035aeced4a21447"
    "sr"
  end
  language "sv" do
    sha256 "8fbb8f5e7cbafed59d3b1bce2f747fa4e68f262630fb511c89197991ec30baed"
    "sv-SE"
  end
  language "szl" do
    sha256 "55a8ff229e06d55bd9d7c99b6c655db201cf7336ea16470872d14e56466f9706"
    "szl"
  end
  language "ta" do
    sha256 "e0b3b10b3a26b2dc0021bca6e49cc5ed36f610b306daa6fc55f32ea516f686eb"
    "ta"
  end
  language "te" do
    sha256 "4286d68f3e9a9237794e2a6bcbf1276fa32880a76ea2c8dfbe2f06a9a4a716ed"
    "te"
  end
  language "tg" do
    sha256 "6cf3ba4c13cdef94d94c852dfc3600fd1a53750080cdc86c87503801a8033ac8"
    "tg"
  end
  language "th" do
    sha256 "b03397993ed7e98961fe21d31f8f03c1b863891265bafcedddcd11be4b83df10"
    "th"
  end
  language "tl" do
    sha256 "6214b13bc9916deea03c4260cde052121536d92ac63730fd7d3cf6749357e5f3"
    "tl"
  end
  language "tr" do
    sha256 "489939df5fe3179fe66dca7cf893e56f7844a5071e2e61cc53c6370b4099d0e5"
    "tr"
  end
  language "trs" do
    sha256 "73e4e57ee129716a77cb4945ad26231f48e653ae5727bb13360b64b498abd104"
    "trs"
  end
  language "uk" do
    sha256 "031e88dc9ea98096a076754d2b340fca5bd55d1a3c3535d0db9e911f738098b7"
    "uk"
  end
  language "ur" do
    sha256 "f66cc79f184ddd54002ba9d5a6f214dfa8ea820e0816ba64c87869a5b556be15"
    "ur"
  end
  language "uz" do
    sha256 "605c083d735bfb862276151c31a7fefe9445ca7bbaeca1774df7ce98fc8c8a0a"
    "uz"
  end
  language "vi" do
    sha256 "283064355c9a02eeafc83576b861906946c7abe698050cab3dd7d1d2268383bc"
    "vi"
  end
  language "xh" do
    sha256 "413162df2930513c8411632b03f8efad8f41167e2b89abe53506c35808d32dd6"
    "xh"
  end
  language "zh-TW" do
    sha256 "831ca84df620e0b86104da8ae6bf0bd88139e175fe52632aba86571f90dc5789"
    "zh-TW"
  end
  language "zh" do
    sha256 "83b4b16e61fd9ecc47ba39b059a815835b9bf381f5c760fca0a705c04635be2c"
    "zh-CN"
  end

  url "https://download-installer.cdn.mozilla.net/pub/firefox/releases/#{version}/mac/#{language}/Firefox%20#{version}.dmg",
      verified: "download-installer.cdn.mozilla.net/pub/firefox/releases/"
  name "Mozilla Firefox"
  desc "Web browser"
  homepage "https://www.mozilla.org/firefox/"

  livecheck do
    url "https://product-details.mozilla.org/1.0/firefox_versions.json"
    strategy :json do |json|
      json["LATEST_FIREFOX_VERSION"]
    end
  end

  auto_updates true
  conflicts_with cask: [
    "firefox@beta",
    "firefox@cn",
    "firefox@esr",
  ]

  app "Firefox.app"
  # shim script (https://github.com/Homebrew/homebrew-cask/issues/18809)
  shimscript = "#{staged_path}/firefox.wrapper.sh"
  binary shimscript, target: "firefox"

  preflight do
    File.write shimscript, <<~EOS
      #!/bin/bash
      exec '#{appdir}/Firefox.app/Contents/MacOS/firefox' "$@"
    EOS
  end

  uninstall quit: "org.mozilla.firefox"

  zap trash: [
        "/Library/Logs/DiagnosticReports/firefox_*",
        "~/Library/Application Support/com.apple.sharedfilelist/com.apple.LSSharedFileList.ApplicationRecentDocuments/org.mozilla.firefox.sfl*",
        "~/Library/Application Support/CrashReporter/firefox_*",
        "~/Library/Application Support/Firefox",
        "~/Library/Caches/Firefox",
        "~/Library/Caches/Mozilla/updates/Applications/Firefox",
        "~/Library/Caches/org.mozilla.crashreporter",
        "~/Library/Caches/org.mozilla.firefox",
        "~/Library/Preferences/org.mozilla.crashreporter.plist",
        "~/Library/Preferences/org.mozilla.firefox.plist",
        "~/Library/Saved Application State/org.mozilla.firefox.savedState",
        "~/Library/WebKit/org.mozilla.firefox",
      ],
      rmdir: [
        "~/Library/Application Support/Mozilla", #  May also contain non-Firefox data
        "~/Library/Caches/Mozilla",
        "~/Library/Caches/Mozilla/updates",
        "~/Library/Caches/Mozilla/updates/Applications",
      ]
end
